import {createStore} from 'vuex';
import persistedstate from 'vuex-persistedstate'
import user from './modules/user';
import menu from './modules/menu';
import setting from './modules/setting';

const store = createStore({
    modules: {
        user,
        menu,
        setting
    },
    plugins: [
        persistedstate({
            storage: window.localStorage,
            reducer(val) {
                return {
                    menu: val.menu
                }
            }
        })
    ]
})

export default store